package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.mapper.DishFlavorMapper;
import com.itheima.pojo.DishFlavor;
import com.itheima.service.DishFlavorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 放学后海堤日记
 * @Date: 2023/4/15 14:36
 * @Desc:
 */
@Service
public class DishFlavorServiceImpl implements DishFlavorService {
    @Autowired
    private DishFlavorMapper dishFlavorMapper;
    @Override
    public void deleteDishFlavorByDishId(Long[] ids) {
        for (Long id : ids) {
            QueryWrapper<DishFlavor> wrapper = new QueryWrapper<>();
            wrapper.eq("dish_id", id);

            dishFlavorMapper.delete(wrapper);
        }
    }
}
